

jQuery(function ($) {
    requestMainNav();
    //获取主导航
    function requestMainNav() {
        var params = {
            "Nav[]": {
                "Nav": {
                    "type": 1,
                    "@order": "rank-",
                    "use_flag": 1
                }
            },
            "Tdk": {
                "type": 1
            }
        };
        send_ajax('post', '/get', params, function callback(res) {
            if (res.code = 200 && res["Nav[]"]) {
                var data = res["Nav[]"];
                var html = '';
                for (var i = 0; i < data.length; i++) {
                    var a_nav = data[i];
                    var temp = "<a href=\"" + a_nav.url + "\" target=\"_blank\" class="+(a_nav.name=='采购大厅'?'hall':'')+">" + a_nav.name + "</a>";
                    html += temp;
                };
                $('.main_head nav').html(html);
            } else {
                alert('网络加载失败，请稍后再试！');
            }
        });
    }
});